#include <iostream>
#include <string>
using namespace std;

class Person{
protected:
  string _name;
  string _id;
  int _age;

public:
  void Print(){
    cout << _name << " ";
    cout << _id << " ";
    cout << _age << endl;
  }
};

class Student : public Person{
  string _stdid;
public:
  void init(string name, string id, int age, string stdid){
    _name = name;
    _id = id;
    _age = age;
    _stdid = stdid;
  }
};

class Teacher : public Person{
  string _jobid;
public:
  void init(string name, string id, int age, string jobid){
    _name = name;
    _id = id;
    _age = age;
    _jobid = jobid;
  }
};

//void Test1(){
//  Student s;
//  s._name = "张三";
//  s._id = "123456";
//  s._age = 18;
//
//  Teacher t;
//  t._name = "王老师";
//  t._id = "78910";
//  t._age = 30;
//
//  s.Print();
//  t.Print();
//}

void Test2(){
  Student s;
  s.init("张三", "123456", 18, "111");
  Teacher t;
  t.init("王老师", "78910", 30, "222");
  s.Print();
  t.Print();
}

void Test4(){
  Student s;
  s.init("张三", "123456", 18, "111");
  Person p = s;
  p.Print();
  Person *pp = &s;
  pp->Print();
  Person &rp = s;
  rp.Print();
}

int main(){
  Test4();
  return 0;
}
